//
// Created by antler on 2018/12/6.
//

#ifndef LUA_COLOR3B_H
#define LUA_COLOR3B_H

#include <string>

class Color3F;

#define USERTYPE_COLOR3B "Color3B"
#define CLASSNAME_COLOR3B "Color3B"

#ifndef COLOR_INVALID
#define COLOR_INVALID 0xFFFFFFFF
#endif // COLOR_INVALID

class Color3B {
public:
    static Color3B *create();

    static Color3B *createWith(int rgb);

    static Color3B *createWith(int r, int g, int b);

    static Color3B *createWith(const std::string &rgb);

    static Color3B *createWith(const Color3F &c3f);

    static Color3B *createWith(const Color3B &c3b);

    Color3B();

    Color3B(int rgb);

    Color3B(int r, int g, int b);

    Color3B(const Color3F &c3f);

    int toInt() const;

    std::string toString() const;

    bool isEqual(const Color3B &other, int offset, int fuzziness);

public:
    int r, g, b;
};


#endif //LUA_COLOR3B_H
